<?php
// $Id: Node.interface.php 73 2007-02-12 03:45:43Z tswicegood $

/**
 * This file contains {@link Node} which is part of the PHP Content Repository
 * (phpCR), a derivative of the Java Content Repository JSR-170,  and is 
 * licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 */


/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/phpCR.library.php');

phpCR::loadInterface('Item');
phpCR::loadInterface('NodeDef', '/nodetype');
phpCR::loadInterface('NodeType', '/nodetype');

if (phpCR::getLevel() >= 2) {
    phpCR::loadInterface('Version', '/version');
    phpCR::loadInterface('VersionHistory', '/version');
    phpCR::loadInterface('VersionIterator', '/version');
}


/**
 * The {@link Node} interface represents a {@link Node} in the hierarchy that makes up 
 * the repository.
 *
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 */
interface Node extends Item
{

   /**
    * Creates a new {@link Node} at relPath. The new {@link Node} will only be
    * persisted in the workspace when save() and if the structure
    * of the new {@link Node} (its child {@link Node}s and properties) meets the constraint
    * criteria of the parent {@link Node}'s {@link NodeType}.
    * 
    * If relPath implies intermediary {@link Node}s that do not
    * exist then a PathNotFoundException is thrown.
    *
    * If an {@link Item} already exists at relPath then an
    * ItemExistsException is thrown.
    * 
    * If an attempt is made to add a {@link Node} as a child of a
    * {@link Property} then a ConstraintViolationException is
    * thrown immediately (not on {@link save()}).
    * 
    * Since $this signature does not allow explicit {@link NodeType} assignment, the
    * new {@link Node}'s {@link NodeType}s (primary and mixin, if applicable) will be
    * determined immediately (not on save) by the NodeDefs
    * in the {@link NodeType}s of its parent. If there is no NodeDef
    * corresponding to the name specified for $this new {@link Node}, then a
    * ConstraintViolationException is thrown immediately (not on
    * {@link save()}).
    *
    * If a $primaryNodeTypeName is specified and is not recognized,
    * then a {@link NoSuchNodeTypeException} is thrown
    *
    * @param string The path of the new {@link Node} to be created.
    * @param string The name of the primary {@link NodeType} of the new 
    *   {@link Node}.
    * @return The {@link Node} that was added.
    * @throws {@link ItemExistsException}
    *   If an {@link Item} at the specified path already exists.
    * @throws {@link PathNotFoundException}
    *   If the specified path implies intermediary {@link Node}s that do not 
    *   exist.
    * @throws {@link ConstraintViolationException}
    *   If there is no {@link NodeDef} corresponding to the name specified for
    *   $this new {@link Node} in the parent  {@link Node}'s 
    *   {@link NodeType}, or if an attempt is made to add a {@link Node} as a child of 
    *   a {@link Property}.
    * @throws {@link NoSuchNodeTypeException}
    *   If a $primaryNodeTypeName is specified and not recognized.
    * @throws RepositoryException If another error occurs.
    */
    public function addNode($relPath, $primaryNodeTypeName = null);

    
   /**
    * Adds the existing {@link Node} at $absPath as child of 
    * $this {@link Node}, thus adding $this 
    * {@link Node} as an addional parent of the {@link Node} at
    * $absPath.
    *
    * This change will be persisted (if valid) on {@link save()}.
    *
    * If the {@link Node} at $absPath is not of mixin type
    * mix:referenceable, a {@link ConstraintViolationException}
    * will be thrown on {@link save()}.
    *
    * The name of the new child {@link Node} as accessed from $this
    * {@link Node} will be the same as its current name in $absPath
    * (that is, the last path segment in that $absPath).
    *
    * If $newName is specified, $this {@link Node}
    * should assume the new name.
    *
    * @param string 
    *   The absolute path of the new child {@link Node}.
    * @param string 
    *   The new name for $this {@link Node} when referenced as a 
    *   child of $this {@link Node}.  (Optional)
    * @return object 
    *   The new child {@link Node}.
    * @throws {@link PathNotFoundException}
    *   If no {@link Node} exists at $absPath.
    * @throws {@link RepositoryException}
    *   In level 2: If another error occurs.
    */
    public function addExistingNode($absPath, $newName = null);
    
    
   /**
    * Sets the specified {@link Property} to the specified value. If the 
    * {@link Property} does not yet exist, it is created. 
    *
    * If $type is NULL, the {@link PropertyType} will
    * be that specified by the {@link NodeType} of $this 
    * {@link Node} (the one on which $this method is being called). 
    *
    * If the {@link NodeType} of the parent {@link Node} does not specify a
    * specific {@link PropertyType} for the {@link Property} being set, then the
    * {@link PropertyType} of the supplied {@link Value} object is used.
    *
    * If the {@link Property} already exists (has previously been set) it 
    * assumes the new value. If the {@link NodeType} of the parent {@link Node}
    * does not specify a specific {@link PropertyType} for the {@link Property}
    * being set, then the {@link Property} will also assume the new type 
    * (if different).
    *
    * To erase a {@link Property}, use {@link remove()}.
    *
    * To persist the addition or change of a {@link Property} to the workspace
    * {@link save()} must be called on $this {@link Node} (the 
    * parent of the {@link Property} being set) or a higher-order ancestor of 
    * the {@link Property}.
    *
    * @param string 
    *   The name of a {@link Property} of $this {@link Node}
    * @param mixed 
    *   The value to be assigned
    * @param int|null 
    *   The type of the {@link Property} (Optional: NULL if not
    *   specified).
    * @return object 
    *   The updated {@link Property} object
    * @throws {@link ValueFormatException}
    *   If $value is incompatible with (i.e. can not be converted 
    *   to) the type of the specified {@link Property}.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function setProperty($name, $value, $type = null);
    
    
   /**
    * Removes the parent-child binding along $relPath to the 
    * {@link Item}.
    *
    * If $this {@link Item} is a {@link Node} that has other 
    * references to it (due to multiple parents), then all of these other 
    * references to the {@link Node} are preserved.  If the {@link Item} at
    * path has no other references to it then it is actually erased, along with
    * any child {@link Item}s that also have no other references and so on down 
    * the subtree. 
    *
    * A call to save (either on {@link Ticket} or on an ancestor of the newly 
    * removed {@link Node}) is required to persist the removal.
    *
    * @param string
    *   The path of the {@link Item} to be removed.
    * @throws {@link PathNotFoundException}
    *   If no {@link Item} exists at $relPath.
    * @throws {@link RepositoryException} If another error occurs.
    */
    public function remove($relPath);
    
    
   /**
    * Validates and (if validation succeeds) persists all changes to 
    * $this {@link Node} made via the {@link Ticket} through which 
    * $this {@link Node} object was acquired.
    *
    * If $shallow is FALSE then all pending changes
    * to $this {@link Node} and all its descendants are validated 
    * and (if validation succeeds) persisted.
    *
    * If $shallow is TRUE then pending changes to
    * $this {@link Node} only are validated and (if validation 
    * succeeds) persisted.
    *
    * The changes persisted are:
    * <ul>
    *   <li>New properties added to $this {@link Node}.</li>
    *   <li>Changes to values of existing properties of $this 
            {@link Node}</li>
    *   <li>Removal of properties from $this {@link Node}</li>
    *   <li>Removal of child {@link Node}s from $this 
            {@link Node}</li>
    * </ul>
    *
    * Constraints mandated by {@link NodeType}s are validated on save. If
    * validation fails a {@link ConstraintViolationException} is thrown and the 
    * state of the transient storage is left unaffected.
    *
    * An {@link AccessDeniedException} will be thrown if an attempt is made to
    * save changes for which the current ticket does not have sufficient access
    * rights.
    *
    * An {@link ActionVetoedException} will be thrown if a 
    * {@link VetoableEventListener} vetoes one of the changes being saved.
    *
    * If save succeeds then the changes persisted are removed from the cache
    * of pending changes in the ticket.
    *
    * @param bool 
    *   If FALSE then $this {@link Node} and its 
    *   subtrree is saved.  If TRUE then only $this 
    *   {@link Node} is saved.
    * @throws {@link ConstraintViolationException}
    *   If any of the changes would violate a constraint as defined by the
    *   {@link Node} type of the respective {@link Node}.
    * @throws {@link AccessDeniedException} 
    *   If the current ticket does not have sufficient access rights to 
    *   complete the operation.
    * @throws {@link ActionVetoedException}
    *   If a {@link VetoableEventListener} vetoes one of the changes being 
    *   saved.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function save($shallow);
    
    
   /**
    * Returns the {@link Node} at $relPath relative to 
    * $this {@link Node}.
    *
    * The properties and child {@link Node}s of the returned {@link Node} can 
    * then be read (and if permissions allow) changed and written. However, any 
    * changes made to $this {@link Node}, its properties or its
    * child {@link Node}s (and their properties and child {@link Node}s, etc.) 
    * will only be persisted to the repository upon calling {@link save()}.
    * 
    * Within the scope of a single {@link Ticket} object, if a {@link Node} has
    * been acquired with {@link getNode()}, any subsequent call of 
    * {@link getNode()} re-acquiring the same {@link Node} will return a 
    * reference to same object, not a new copy.  PHP NOTE: As PHP does not 
    * maintain a constant state, this should not be much of an issue.
    *
    * @param string
    *   The relative path of the {@link Node} to retrieve.
    * @return object 
    *   The {@link Node} at $relPath.
    * @throws {@link PathNotFoundException}
    *   If no {@link Node} exists at the  specified path.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getNode($relPath);
    
    
   /**
    * Returns a {@link NodeIterator} over all child {@link Node}s of
    * $this {@link Node}.
    *
    * If $namePattern is specified, $this only returns
    * those {@link Node}s which make that pattern.  The pattern may be a full 
    * name or a partial name with one or more wildcard characters 
    * ("*"), or a disjunction ("|" or 
    * "OR")
    *
    * Example:
    * $N.getNodes("jcr:*" | myapp:report")
    *
    * Would return a {@link NodeIterator} holding all of the child {@link Node}s 
    * of $N that are either called myapp:report or 
    * begin with the prefix jcr:.  The pattern does not represent 
    * paths, that is, it may not contain / characters.
    *
    * Does not include properties of $this {@link Node}. 
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @param string
    *   A name pattern.
    * @return object
    *   A {@link NodeIterator} over all child {@link Node}s of $this 
    *   {@link Node}.
    * @throws {@link RepositoryException}
    *   If an unexpected error occurs.
    */
    public function getNodes($namePattern = null);
    
    
   /**
    * Returns the {@link Property} at $relPath relative to 
    * $this {@link Node}. 
    *
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @param string
    *   The relative path of the {@link Property} to retrieve.
    * @return object
    *   A {@link Property} object contain the {@link Property} of 
    *   $relPath.
    * @throws {@link PathNotFoundException}
    *   If no {@link Property} exists at the specified path.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getProperty($relPath);
    
    
   /**
    * Returns a {@link PropertyIterator} that contains all of the properties of 
    * $this {@link Node}.
    *
    * If $namePattern is specified, only return those 
    * {@link Property}s that match the specified pattern.  
    * $namePattern works identically to that {@link getNodes()}.
    *
    * Does not include child {@link Node}s of $this
    * {@link Node}.
    * 
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @return A PropertyIterator.
    * @throws {@link RepositoryException}
    *   If an error occurs.
    */
    public function getProperties($namePattern);
    
    
   /**
    * Returns the first {@link Property} of $$this 
    * {@link Node} found with the specified $value.
    *
    * What makes a particular {@link Property} "first" (that is, the search 
    * order) is implementaion dependent. If the specified value and the value 
    * of a {@link Property} are of different types then a conversion is 
    * attempted before the equality test is made. Returns NULL if
    * no such {@link Property} is found. In the case of multivalue properties, 
    * a {@link Property} qualifies as having the specified value if and only if
    * at least one of its values matches.
    *
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @param object
    *   A {@link Value} object.
    * @return object
    *   The first {@link Property} of $this {@link Node} found with
    *   the specified value.
    * @throws {@link RepositoryException}
    *   If an unexpected error occurs.
    */
    public function findProperty(Value $value);
    
    
   /**
    * Returns a {@link PropertyIterator} containing all of the {@link Property}s
    * of $this {@link Node} with the specified value.
    *
    * If the specified {@link Value} and the {@link Value} of a {@link Property} 
    * are of different types then a conversion is attempted before the equality
    * test is made. 
    *
    * Returns an empty iterator if no such {@link Property} could be found. In 
    * the case of multi-value properties, a {@link Property} qualifies as 
    * having the specified value if and only if at least one of its values 
    * matches.
    *
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @param object
    *   A {@link Value} object.
    * @return object
    *   A {@link PropertyIterator} holding all {@link Property}s of $this 
    *   {@link Node} with the specified value. Returns an empty 
    *   {@link PropertyIterator} if no such {@link Property} could be found.
    * @throws {@link RepositoryException}
    *   If an unexpected error occurs.
    */
    public function findProperties(Value $value);
    
    
   /**
    * Returns the deepest primary child {@link Item} accessible via a chain of
    * primary child {@link Item}s from $this {@link Node}.
    *
    * A {@link Node}'s type can specifiy a maximum of one of its child 
    * {@link Item}s (child {@link Node} or {@link Property}) as its primary
    * child {@link Item}.
    *
    * This method traverses the chain of primary child {@link Item}s of 
    * $this {@link Node} until it either encounters a 
    * {@link Property} or a {@link Node} that does not have a primary child 
    * {@link Item}. It then returns that {@link Property} or {@link Node}. If 
    * $this {@link Node} itself (the one that $this 
    * method is being called on) has no primary child {@link Item} then 
    * $this method throws a {@link ItemNotFoundException}. 
    *
    * The same {@link save()} and re-acquisition semantics apply as with 
    * {@link getNode()}.
    *
    * @return object
    *   The deepest primary child {@link Item} accessible from $this 
    *   {@link Node} via a chain of primary child {@link Item}s.
    * @throws {@link ItemNotFoundException}
    *   If $this {@link Node} does not have a primary child {@link Item}.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getPrimaryItem();
    
    

   /**
    * Returns the UUID of $this {@link Node} as recorded in the
    * {@link Node}'s jcr:UUID {@link Property}. 
    *
    * This method only works on {@link Node}s of mixin {@link Node} type 
    * mix:referenceable. On nonreferenceable {@link Node}s, 
    * $this method throws an 
    * {@link UnsupportedRepositoryOperationException}.
    *
    * @return string
    *   The UUID of $this {@link Node}
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If $this {@link Node} nonreferenceable.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getUUID();
    
    
   /**
    * Indicates whether a {@link Node} exists at $relPath
    *
    * Returns TRUE if a {@link Node} exists at 
    * $relPath and FALSE otherwise.
    *
    * @param string
    *   The path of a possible {@link Node}.
    * @return bool
    *   TRUE if a {@link Node} exists at relPath;
    *   FALSE otherwise.
    * @throws {@link RepositoryException}
    *   If an unspecified error occurs.
    */
    public function hasNode($relPath);
    
    
   /**
    * Indicates whether a {@link Property} exists at $relPath.
    *
    * @param string
    *   The path of a possible {@link Property}.
    * @return bool
    *   TRUE if a {@link Property} exists at $relPath;
    *   FALSE otherwise.
    * @throws {@link RepositoryException}
    *   If an unspecified error occurs.
    */
    public function hasProperty($relPath);
    
    
   /**
    * Indicates whether $$this {@link Node} has child 
    * {@link Node}s.
    * 
    * @return bool
    *   TRUE if $this {@link Node} has one or more child 
    *   {@link Node}s; FALSE otherwise.
    * @throws {@link RepositoryException}
    *   If an unspecified error occurs.
    */
    public function hasNodes();
    
    
   /**
    * Indicates whether $$this {@link Node} has 
    * {@link Property}s.
    *
    * @return bool
    *   TRUE if $this {@link Node} has one or more 
    *   {@link Property}s; FALSE otherwise.
    * @throws {@link RepositoryException}
    *   If an unspecified error occurs.
    */
    public function hasProperties();
    
    
   /**
    * Returns the primary {@link NodeType} of $this {@link Node}.
    *
    * @return object
    *   A {@link NodeType} object.
    */
    public function getPrimaryNodeType();
    
    
   /**
    * Returns an array of {@link NodeType} objects representing the mixin 
    * {@link Node} types assigned to $this {@link Node}.
    *
    * @return array
    *   An array of NodeType objects.
    */
    public function getMixinNodeTypes();
    
    
   /**
    * Indicates whether $this {@link Node} is of the specified 
    * {@link NodeType}.
    *
    * This method provides a quick method for determining whether a particular 
    * {@link Node} is of a particular {@link NodeType} without having to 
    * manually search the inheritance hierarchy (which, in some implementations
    * may be a multiple-inhertiance hierarchy, making a manual search even
    * more complex). This method works for both primary {@link NodeType}s and
    * mixin {@link NodeType}s.
    *
    * @param string
    *   The name of a {@link NodeType}.
    * @return bool
    *   TRUE if $this {@link Node} is of the specified 
    *   {@link NodeType} or a subtype of the specified {@link NodeType}; returns
    *   FALSE otherwise.
    * @throws {@link RepositoryException}
    *   If an unspecified error occurs.
    */
    public function isNodeType($nodeTypeName);
    
    
   /**
    * Adds the specified mixin {@link NodeType} to $this 
    * {@link Node}. 
    *
    * If a conflict with another assigned mixin or the main {@link NodeType} 
    * results, an exception is thrown on {@link save()}. Adding a mixin 
    ( {@link NodeType} to a {@link Node} immediately adds the name of that type
    * to the list held in that {@link Node}'s jcr:mixinTypes
    * {@link Property}.
    *
    * @param string 
    *   The mixin name
    */
    public function addMixin($mixinName);
    
    
   /**
    * Returns the definition of $this {@link Node}. 
    *
    * This method is actually a shortcut to searching through $this
    * {@link Node}'s parent's {@link NodeType} (and its supertypes) for the 
    * child {@link Node} definition applicable to $this
    * {@link Node}.
    *
    * @return object 
    *   A {@link NodeDef} object.
    * @see NodeType::getChildNodeDefs()
    */
    public function getDefinition();
    
    
   /**
    * Creates a new {@link Version} with a system generated {@link Version} name 
    * and returns that {@link Version}.
    *
    * Level 2 Implementation
    *
    * @return object 
    *   A {@link Version} object
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function checkin();
    
    
   /**
    * Sets $this versionable {@link Node} to checked-out status by
    * setting its jcr:isCheckedOut {@link Property} to true.
    *
    * Level 2 Implementation
    *
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function checkout();
    
    
   /**
    * Updates $this {@link Node} to reflect the state (i.e., have
    * the same {@link Property}s and child {@link Node}s) of $this
    * {@link Node}'s corresponding {@link Node} in $srcWorkspace
    * (that is, the {@link Node} in $srcWorkspace with the same 
    * UUID as $this {@link Node}). 
    *
    * If the {@link update()} succeeds the changes made to $this
    * {@link Node} are persisted immediately, there is no need to call 
    * {@link save()}.
    *
    * @param string
    *   The name of the source workspace.
    * @param bool
    *   If shallow is set to FALSE, then only $this 
    *   {@link Node} is updated. If shallow is set to TRUE then 
    *   every {@link Node} with a UUID in the subtree rooted at 
    *   $this {@link Node} is updated. 
    *   
    * @throws {@link NoSuchWorkspaceException}
    *   If the current {@link Ticket} does not have sufficient rights to
    *   perform the {@link update()} or the specified workspace does not exist.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function update($scrWorkspaceName, $shallow);
    

   /**
    * Performs the same function as {@link update()} with one restriction:
    * merge only succeeds if the base {@link Version} of the corresponding 
    * {@link Node} in $srcWorkspace is a successor (or a successor 
    * of a successor, etc., to any degree of separation) of the base 
    * {@link Version} of $this {@link Node}. Otherwise,
    * the operation throws a {@link MergeException}. 
    *
    * In repositories that do not support versioning, {@link merge()} throws an
    * UnsupportedRepositoryOperationException. 
    *
    * If the {@link merge()} succeeds, the changes made to $this 
    * {@link Node} are persisted immediately, there is no need to call 
    * {@link save()}.
    *
    * Level 2 Implementation
    *
    * @param string
    *   The name of the source workspace.
    * @param bool
    *   d51 Note: Same update()? 
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link MergeException}
    *   If {@link merge()} is not successful.
    * @throws {@link NoSuchWorkspaceException}
    *   If the current {@link Ticket} does not have sufficient rights to perform 
    *   the {@link merge()} or the specified workspace does not exist.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function merge($srcWorkspace, $shallow);
    
    
   /**
    * Returns TRUE if $this {@link Node} is currently 
    * checked-out and FALSE otherwise.
    *
    * Level 2 Implementation
    *
    * @return bool
    *   Is this checked out?
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function isCheckedOut();
    
    
   /**
    * Restores $this {@link Node} to the state recorded in the 
    * specified {@link Version}.
    *
    * Level 2 Implementation
    *
    * @param mixed
    *   The point to restore to.  Valid parameters include a string containing
    *   the version name, a {@link Version} object, or a date to restore to.
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function restore($to);
    
    
   /**
    * Restores $this {@link Node} to the state recorded in the 
    * {@link Version} specified by $versionLabel.
    *
    * Level 2 Implementation
    *
    * @param string
    *   The version label to restore to
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function restoreByLabel($versionLabel);
    
    
   /**
    * Returns the {@link VersionHistory} object of $this 
    * {@link Node}. 
    *
    * This object is simply a wrapper for the nt:versionHistory 
    * {@link Node} holding $this {@link Node}'s {@link Version}s.
    *
    * Level 2 Implementation
    *
    * @return object
    *   A {@link VersionHistory} object
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getVersionHistory();
    
    
   /**
    * Returns the current base {@link Version} of $this versionable 
    * {@link Node}.
    *
    * Level 2 Implementation
    *
    * @return object
    *   A Version object.
    * @throws {@link UnsupportedRepositoryOperationException}
    *   If versioning is not supported.
    * @throws {@link RepositoryException}
    *   If another error occurs.
    */
    public function getBaseVersion();
}
